POV-Ray : Newsgroups : povray.windows : C/C++ question. : C/C++ question. Server Time
3 Jul 2024 00:07:15 EDT (-0400)
  C/C++ question.  
From: Andrew Wilcox
Date: 4 Oct 2002 18:16:01
Message: <3d9e1321@news.povray.org>
Ok, I've only got one last thing to add to this silly GUI Extension, and I
just can't figure out how to do it.  It's a simple simple thing to do, I
just haven't worked in C/C++ so long, and I don't have any C++ books
anymore.

From the command-line the user passes in a file let's say "scene.pov".  Now,
POV wants the GUI Extension to pass the full path name of the file, let's
say, "c:\povfiles\scene.pov".

Here are my questions.  How can I tell if a file exists?  How can I get the
"current working directory" in a C program? in a C++ program?  How can I
tell if a file path is absolute?  This will only ever run on Windows, so
Windows API calls are ok too...

Thanks!
--
#macro Q(A,E,W)box{-A/2,A/2pigment{rgb 9*W}translate E*A+W/1000}#end#macro
M(D,E)#local A=1/pow(3,D);#if(D<3)#local C=D+1;union{M(C,1)M(C,x+y)M(C,x+z)
M(C,y+z)M(C,x+y-z)M(C,x+z-y)M(C,y+z-x)M(C,x-y)M(C,z-x)M(C,y-z)M(C,y-x)M(C,
x-z)M(C,z-y)M(C,x-y-z)M(C,y-x-z)M(C,z-x-y)translate A*E}#else Q(A,E,x)Q(A,E
,y)Q(A,E,z)#end#end union{M(0,0)rotate<45,145,0>translate z*2}//Andrew


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.